home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1988 April
/
1988-04.d64
/
dgraph painter
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
101 lines
10 printchr$(14);chr$(8):lx%=4:ly%=195
20 poke50913,1:poke50959,1:poke50918,0
30 poke50964,0:poke50923,0:poke50969,0
40 @2:x%=4:y%=195
50 if x%<0 then x%=319
60 if x%>319 then x%=0
70 if y%<0 then y%=199
80 if y%>199 then y%=0
90 c1%=5:c2%=6:@4,x%,y%:if(peek(251)<>0)thenc1%=6:c2%=5
100 @c1%,x%,y%
110 xt%=peek(56320)and31
120 jx%=sgn(xt%and4)-sgn(xt%and8)
130 jy%=sgn(xt%and2)-sgn(xt%and1)
140 jf%=1-sgn(xt%and16)
150 if(jx%<>0)or(jy%<>0)goto200
160 getc$:c%=peek(653)and4
170 if(c$="")and(c%=0)goto110
180 if(c%=0)goto220
190 goto380
200 if(jf%<>0)thenc2%=c1%
210 @c2%,x%,y%:x%=x%+jx%:y%=y%+jy%:goto50
220 cx%=x%/8:cy%=y%/8:@10,cx%,cy%,c$
230 if(peek(251)=0)goto260
240 if(cx%>38)thenx%=-4:if(cy%>0)theny%=y%-8
250 x%=x%+8:goto50
260 c%=asc(c$):if(c%<>13)goto290
270 @c2%,x%,y%:x%=4:if(y%>7)theny%=y%-8
280 goto50
290 if(c%=29)thenjx%=8:goto210
300 if(c%=157)thenjx%=-8:goto210
310 if(c%=145)thenjy%=8:goto210
320 if(c%=17)thenjy%=-8:goto210
330 if(c%=19)then@c2%,x%,y%:x%=4:y%=195:goto50
340 if(c%=147)then@3:x%=4:y%=195:goto50
350 if(c%<>20)goto110
360 @c2%,x%,y%:if(x%>7)thenx%=x%-8:cx%=x%/8:cy%=y%/8:@10,cx%,cy%," "
370 goto50
380 print"[147]";
390 print" [207]ptions [146]";
400 print" g -> [199]et a [198]ile"
410 print" s -> [211]ave a [198]ile"
420 print" p -> [208]rint [211]creen"
430 print" d -> [196]raw a [204]ine"
440 print" f -> [198]ill a [210]egular [208]olygon"
450 print" u -> [213]ppercase"
460 print" l -> [204]owercase"
470 print" n -> [206]ormal [195]haracters"
480 print" r -> [210]everse [195]haracters"
490 print" c -> [195]lear [211]creen"
500 print" q -> [209]uit"
510 print"[197]nter [207]ption:[146] ";:@1
520 getc$:if(c$="")goto520
530 printc$+""
540 if(c$<>"g")goto580
550 c$="":input"[199]et [198]ilename";c$
560 if(c$="")thenprint"[147][199]et a [198]ile [193]borted -- [197]nter [195]ommand":goto390
570 print"[199]etting [198]ile...":@13,c$:@2:goto50
580 if(c$<>"s")goto620
590 c$="":input"[211]ave [198]ilename";c$
600 if(c$="")thenprint"[147][211]ave a [198]ile [193]borted -- [197]nter [195]ommand":goto390
610 print"[211]aving [198]ile...":@c2%,x%,y%:@12,c$:@c1%,x%,y%:@2:goto110
620 if(c$<>"p")goto670
630 print"[211]ure [208]rint (y/n)? "
640 getc$:if(c$="")goto640
650 if(c$<>"y")thenprint"[147][208]rint [193]borted -- [197]nter [195]ommand":goto390
660 print"[208]rinting...":@c2%,x%,y%:@14:@c1%,x%,y%:@2:goto110
670 if(c$<>"d")goto800
680 print" [196]raw [207]ptions [146]"
690 print" s -> [211]et [211]tarting [208]oint"
700 print" d -> [196]raw the [204]ine"
710 print"[197]nter [196]raw [207]ption:[146] ";
720 getc$:if(c$="")goto720
730 printc$
740 if(c$<>"s")goto760
750 lx%=x%:ly%=y%:c2%=c1%:@2:goto110
760 if(c$<>"d")thenprint"[147][204]ine [193]borted -- [197]nter [195]ommand":goto390
770 s%=256:input"[204]ine [211]tyle (0-255)";s%
780 if((s%<0)or(s%>255))thenprint"[147][196]raw [204]ine [193]borted -- [197]nter [195]ommand":goto390
790 @2:@4,lx%,ly%:@7,x%,y%,s%:lx%=x%:ly%=y%:goto50
800 if(c$<>"f")goto880
810 print"[201]s [205]arker in [208]olygon (y/n)? ";
820 getc$:if(c$="")goto820
830 printc$
840 if(c$<>"y")thenprint"[147][198]ill [193]borted -- [197]nter [195]ommand":goto390
850 s%=128:input"[198]ill [211]tyle (0-127)";s%
860 if((s%<0)or(s%>127))thenprint"[147][198]ill [193]borted -- [197]nter [195]ommand":goto390
870 @2:@6,x%,y%:@9,x%,y%,s%:goto50
880 if(c$="u")thenc$=chr$(142):@10,0,0,c$:@2:goto110
890 if(c$="l")thenc$=chr$(14):@10,0,0,c$:@2:goto110
900 if(c$="n")thenc$=chr$(146):@10,0,0,c$:@2:goto110
910 if(c$="r")thenc$=chr$(18):@10,0,0,c$:@2:goto110
920 if(c$="c")then@3:@2:goto110
930 print" [209]uit [207]ptions [146]"
940 print" j -> [210]eturn to [202][207][217]"
950 print" b -> [199]o to [194][193][211][201][195]"
960 print"[197]nter [209]uit [207]ption:[146]"
970 getc$:if(c$="")goto970
980 if(c$="j")then@2:goto110
990 if(c$="b")then@c2%,x%,y%:print"[147]":@1:printchr$(142);chr$(9):end
1000 print"[147][209]uit [193]borted -- [197]nter [195]ommand":goto390